package com.hw.protocol.tool.decode.hw;

import com.hw.protocol.tool.model.entity.hw.AbsPressMeter;
import com.hw.protocol.tool.model.entity.hw.Dtu60;

/**
 * @author : lihy
 * @date : 2023/3/23 15:24
 * description: 压力计(6020/6019)实时数据解码器
 */
public class Dtu60Decode extends PressMeterDecodeTemplate {

    private Dtu60 pm;

    public Dtu60Decode(AbsPressMeter pm, byte[] data) {
        super(pm, data);
        this.pm = (Dtu60) pm;
    }

    @Override
    void setAlarm() {
        pm.setAlarm(dataBuf.readFloatLE());
    }

    @Override
    void setPress() {
        pm.setPress1(dataBuf.readFloatLE());
        pm.setPress2(dataBuf.readFloatLE());
    }
}
